// 导入axios
import request from '@/utils/request.js'

/**
 * 获取文章列表模块：
 */
export const getArticleList = (data) => {
  return request({
    method: 'GET',
    url: '/articles',
    data
  })
}
/**
 * 获取文章数据添加模块：
 */
export const addArticle = (data) => {
  return request({
    method: 'POST',
    url: '/articles',
    data
  })
}
/**
 * 获取文章数据修改模块：
 */
export const updateArticle = (articleId) => {
  return request({
    method: 'PUT',
    url: `/articles/${articleId}`
  })
}
/**
 * 获取文章数据删除模块：
 */
export const removeArticleById = (articleId) => {
  return request({
    method: 'DELETE',
    url: `/articles/${articleId}`
  })
}
// 文章状态
export const articleState = (data) => {
  return request({
    method: 'POST',
    url: `/articles/${data.id}/${data.state}`
  })
}
